package org.example.Server.controller.examination;

import lombok.extern.slf4j.Slf4j;
import org.example.Server.model.examination.Exam;
import org.example.Server.service.examination.TeachExamDataService;
import org.example.Server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/youxich/exam/data")
public class TeachExamDataController {
    @Autowired
    private TeachExamDataService teachExamDataService;

    /**
     * 获得试卷概览
     *
     * @param exam
     * @return
     */
    @GetMapping("/paperdata")
    public ResultAPI getPaperdata(Exam exam) {
        return teachExamDataService.getPaperdata(exam);
    }

    /**
     * 获取考试分班具体数据
     *
     * @param exam
     * @return
     */
    @GetMapping("/divisiondata")
    public ResultAPI getDivisionData(Exam exam) {
        return teachExamDataService.getDivisionData(exam);
    }

    /**
     * 获取考试知识点词云
     *
     * @param exam
     * @return
     */
    @GetMapping("/pointdata")
    public ResultAPI getPointData(Exam exam) {
        return teachExamDataService.getPointData(exam);
    }

    /**
     * 获取优秀良好及格不及格人数比例
     *
     * @param exam
     * @return
     */
    @GetMapping("/scoredata")
    public ResultAPI getScoredata(Exam exam) {
        return teachExamDataService.getScoredata(exam);
    }
}
